modname ?=demo
arch ?=arm
ifeq ($(arch),arm)
KERNELDIR := /home/ubuntu/FSMP1A/linux-stm32mp-5.10.10-r0/linux-5.10.10
else
KERNELDIR := /lib/modules/$(shell uname -r)/build/  
endif
#存放内核源码路径的变量

PWD:=$(shell pwd)
#存放当前目录的绝对路径的变量
all:
	make -C $(KERNELDIR) M=$(PWD) modules

clean:
	make -C $(KERNELDIR) M=$(PWD) clean

obj-m:=$(modname).o